package com.serverlite.framework.dao.core;

import java.util.List;

import org.json.JSONObject;

import com.serverlite.framework.dao.mapping.Mapping;
import com.serverlite.framework.utils.JsonUtils;

public class A extends Dao{

    
    public static String saveOrUpdate(Object obj){
        String t = Mapping.getTableName(obj.getClass());
        JSONObject o = JsonUtils.java2json(obj);
        return saveOrUpdate(t,o);
    }
    
    public static void deleteById(Class<?> clazz, Object id) {
        String t = Mapping.getTableName(clazz);
        deleteById(t, id);
    }
    
    public static void batchDeleteByIds(Class<?> clazz, String ids) {
        String t = Mapping.getTableName(clazz);
        batchDeleteByIds(t, ids);
    }
    
    public static <T> List<T> selectAll(Class<T> clazz){
        String t = Mapping.getTableName(clazz);
        return Dao.queryJava("select * from " + t, clazz);
    }
}
